package cn.edu.xmu.oomall.order.microservice;

import cn.edu.xmu.oomall.core.config.OpenFeignConfig;
import cn.edu.xmu.oomall.order.microservice.vo.OrderItemDiscountRetVo;
import cn.edu.xmu.oomall.order.microservice.vo.OrderItemDiscountVo;
import cn.edu.xmu.privilegegateway.annotation.aop.LoginUser;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "coupon-service", configuration = OpenFeignConfig.class)
public interface CouponService {

    /** 根据设定的优惠活动计算当前有效的商品优惠价格 */
    @PutMapping("/internal/discountprices")
    InternalReturnObject<List<OrderItemDiscountRetVo>> discountPrice(@Validated @RequestBody List<OrderItemDiscountVo> orderItemDiscountVos);
}
